package abc;

public class Vipwork {
	Vip[] people = new Vip[30];

	public void add(Vip peo) {
		for (int i = 0; i < people.length; i++) {
			if (people[i] == null) {
				people[i] = peo;
				break;
			}
		}
	}

	public Vip search(String name) {
		Vip peo = null;
		for (int i = 0; i < people.length; i++) {
			if (people[i] != null && name.equals(people[i].order)) {
				peo = people[i];
				break;
			}
		}
		return peo;
	}

	public Vip zhang(String name, int fen) {
		Vip peo1 = null;
		for (int i = 0; i < people.length; i++) {
			if (people[i] != null && name.equals(people[i].order)) {
				people[i].score += fen;
				peo1 = people[i];
			}
		}
		return peo1;
	}

	public void show() {
		for (int i = 0; i < people.length; i++) {
			if (people[i] != null) {
				people[i].show();
			}
		}
	}
}
